%!TEX program = xelatex
\documentclass[t,12pt,aspectratio=169]{beamer} % 16:9 宽屏比例
\usepackage{ctex} % 中文支持
\usepackage{amsmath, amssymb, bm}
\usepackage{graphicx, color}
%\usepackage{natbib}
\usepackage{hyperref}
\usepackage{booktabs}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 或者更彻底地使用 Latin Modern 数学字体（需 lualatex/xelatex）
\usepackage{unicode-math}
%\setmainfont{Latin Modern Roman}
\setmathfont{Latin Modern Math}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{tikz} % 用于绘图
\usetikzlibrary{shapes,arrows}
\usetikzlibrary{circuits.ee.IEC} % 画电路
%\usetikzlibrary{arrows.meta, calc, positioning, quotes, angles, 3d}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 画函数图形
\usepackage{pgfplots} 
\pgfplotsset{compat=1.18} % 推荐设置兼容性版本

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{setspace}
\onehalfspacing
\setlength{\parskip}{1em}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\addtobeamertemplate{frametitle}{}{\vspace*{0.3em}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usetheme{Madrid}
\usecolortheme{default}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{setspace}
\onehalfspacing
\setlength{\parskip}{1em}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\addtobeamertemplate{frametitle}{}{\vspace*{0.3em}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{串联电路的电流的数学模型}
\author{五六七}
%\date{2025年9月13日}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

% 封面页
\begin{frame}
  \titlepage
\end{frame}

% 目录页
\begin{frame}{目录}
  \tableofcontents
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{RL串联电路的数学模型 - 一阶线性常微分方程}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[allowframebreaks]{RL串联电路}

问题：由电源E、电感L和电阻R组成的串联电路如图所示。求电键S闭合后电流强度随时间的变化规律。

\begin{center}
\begin{tikzpicture}[scale=1.3, circuit ee IEC, thick]

    \draw (0,2) to [battery={info'=$E$,name=E}] (0,0);
    \draw (0,0) to [make contact={info'=$S$,name=K}] (3,0);
    \draw (3,0) to [inductor={info'=$L$,name=L}] (3,2);
    \draw (3,2) to [resistor={info'=$R$,name=R}] (0,2);
    
\end{tikzpicture}
\end{center}


解答：设电压为 $E$, 电阻为 $R$, 电感为 $L$, 电流强度为 $I(t)$. 

根据基尔霍夫定律，电路各部分的电压降的总和等于电源的电压降，
$$L\frac{dI}{dt} + RI = E.$$

这是一个一阶线性常微分方程，可以求得通解为 $$I(t) = \frac{E}{R} + C\exp\left(-\frac{R}{L}t\right). $$

电键闭合的一段时间后，电流强度趋于稳定值 $E/R$.  

设初值为 $I(0)=0$, 则 $\displaystyle I(0) = \frac{E}{R} + C\exp\left(-\frac{R}{L}0\right) =0$. 因此 $C=-\frac{E}{R}$. 

从而求得解函数为
$$I(t) = \frac{E}{R} - \frac{E}{R} \exp\left(-\frac{R}{L}t\right). $$

\begin{center}
\begin{tikzpicture}[scale=0.8]
\begin{axis}[
    axis lines = center,              % 坐标轴从原点交叉
    xlabel = $t$,
    ylabel = $I$,
    xlabel style = {at={(ticklabel* cs:1)}, anchor=west},
    ylabel style = {at={(ticklabel* cs:1)}, anchor=south},
    xmin = -1, xmax = 5,
    ymin = -0.5, ymax = 2.5,
    domain = 0:5,                     % 函数定义域
    samples = 30,                     % 采样点数，使曲线平滑
    grid = major,                     % 添加网格
    width=10cm, height=8cm,           % 图像大小
    title = {$I = 2(1-e^{-t})$},
    ticks=both,
    enlargelimits=false,
    clip=true,
    every axis plot post/.append style={ultra thick, blue} % 线条样式
]

% 绘制函数
\addplot [smooth] {2*(1-exp(-x))};

% 可选：添加水平渐近线 y = 2
\addplot[dashed, red, thin] {2};
\node at (axis cs:3.5,2.2) [right, red] {$I = 2$};

\end{axis}
\end{tikzpicture}
\end{center}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{一阶线性常微分方程}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{一阶线性常微分方程}

问题：什么是{\color{red}一阶线性常微分方程}？

解答：从未知函数 $y$ 与其导函数 $\frac{dy}{dx}$ 来看，这个表达式是线性的。

一阶线性常微分方程，{\color{red}非齐次}：$\frac{dy}{dx} = p(x)y + q(x)$.

一阶线性常微分方程，{\color{red}齐次}：$\frac{dy}{dx} = p(x)y$.

作为对比：里卡蒂方程为 $\frac{dy}{dx} = p(x)y^2+q(x)y+r(x)$. 这是{\color{red}非线性常微分方程}。


\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{求解齐次一阶线性常微分方程}
    
问题：求解 $\frac{dy}{dx} = p(x)y$.

解答：分离变量，可得 $\frac{dy}{y} = p(x)dx$.

两边积分，可得，当 $y>0$ 时， $\displaystyle \ln y = \int p(x)dx$. 所以  
$\displaystyle y = \exp\left( \int p(x)dx \right)$. 

当 $y<0$ 时， $\displaystyle \ln (-y) = \int p(x)dx$. 所以  
$\displaystyle y = -\exp\left( \int p(x)dx \right)$. 

当 $y=0$ 时，验证可知也是解函数。

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{求解非齐次一阶线性常微分方程}
    
问题：求解 $\displaystyle \frac{dy}{dx} = p(x)y + q(x)$.

解答：{\color{red}积分因子法}、{\color{red}常数变易法}。

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{一阶线性常微分方程的性质}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{一阶线性常微分方程的性质}

1. 齐次线性常微分方程的解要么恒等于零，要么恒不等于零。

2. 线性常微分方程的解的存在区间是系数函数 $p(x),q(x)$ 的定义域。

3. 齐次线性常微分方程的解函数全体是一个线性空间。

4. 非齐次线性常微分方程的通解可以写成一个特解和相应的齐次方程的解的和。

5. 线性常微分方程的初值问题的解函数存在且唯一。

\end{frame}




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{RLC电路的数学模型 - 二阶线性常微分方程}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[allowframebreaks]{RLC电路的数学模型}

这是一个给{\color{blue}电气工程师}的例子。考虑图示的{\color{red}RLC电路}\cite[p.140]{charnley}。


\begin{center}
\begin{tikzpicture}[scale=1.5, circuit ee IEC, thick]

    \draw (0,2) to [make contact={info'=$S$,name=S}] (0,1);
    \draw (0,1) to [battery={info'=$E$,name=E}] (0,0);
    \draw (0,0) to [resistor={info'=$R$,name=R}] (3,0);
    \draw (3,0) to [inductor={info'=$L$,name=L}] (3,2);
    \draw (3,2) to [capacitor={info'=$C$,name=C}] (0,2);
    
\end{tikzpicture}
\end{center}



有一个电阻，其阻值为$R$欧姆；一个电感，其电感量为$L$亨利；以及一个电容，其电容量为$C$法拉。

还有一个电源（如电池），在时间$t$（以秒为单位）提供电压$E(t)$伏特。


设$Q(t)$为电容器上的电荷量（库仑），$I(t)$为电路中的电流。

两者之间的关系是$Q' = I$。

根据基本原理，我们得到$L I' + R I + Q/C = E$。

由于$Q' = I$，这意味着$I' = Q''$，我们可以将这个方程写为
\[ L Q''(t) + R Q'(t) + \frac{1}{C} Q(t) = E(t). \]

我们也可以通过对方程关于$t$进行微分来以另一种方式书写，从而得到$I(t)$的二阶方程：
\[ L I''(t) + R I'(t) + \frac{1}{C} I(t) = E'(t). \]

这是一个{\color{red}非齐次二阶常系数线性方程}。

由于$L$、$R$和$C$都是正数，这个系统的行为就像{\color{red}质量弹簧系统}一样。

质量的位置被电流所替代。

质量被电感取代，阻尼被电阻取代，弹簧常数被电容的倒数取代。

电压的变化成为强迫函数 -- 对于恒定电压，这是一个无外力作用的运动。


\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{参考文献}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[allowframebreaks]{参考文献}

\begin{thebibliography}{99}
\bibitem{charnley} Matthew Charnley. Differential Equations - An Introduction for Engineers. 

\url{https://sites.rutgers.edu/matthew-charnley/course-materials/differential-equations-an-introduction-for-engineers/}



\end{thebibliography}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}


